<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="__ROOT__/Public/Admin/css/shortcut icon" href="favicon.ico">
    <link href="__ROOT__/Public/Admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/animate.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/js/plugins/cityPicker/city-picker.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/js/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__ROOT__/Public/Admin/css/edit.css" rel="stylesheet"/>
<style>

</style>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
       
        <div class="row">
            <form class="form-horizontal m-t js-ajax-forms" id="signupForm" action="{:U('Admin/ProjectComm/save')}<if condition="$editdata">&type=update<else />&type=add</if>" method="post" enctype="multipart/form-data">
            <div class="col-sm-8  col-md-offset-2">
			<input type="hidden" name="WPID" value="{$WeekId}{$editdata.WPID}">
			<input type="hidden" name="ID" value="{$editdata.ID}">
                <div class="ibox float-e-margins">
                    
                    <div class="ibox-content">

                            <div class="form-group">
                                <label class="col-sm-3 control-label">项目名称</label>
                                <div class="col-sm-8">
                                    <input style="border-color:#cfdadd" type="text" readonly class="form-control" value="{$data.ProjectName}{$editdata.ProjectName}">
                                </div>
                            </div>
                            
                            <div class="form-group has-success">
                                <label class="col-sm-3 control-label" style="color:#686b6d">沟通时间*</label>
                                <div class="col-sm-8">
                                    <input style="border-color:#cfdadd" type="text" id="ComTime" name="ComTime" class="form-control date laydate-icon"" value="{$editdata.ComTime}">
                                </div>
                            </div>

                           
                            <div class="form-group">
                                <label class="col-sm-3 control-label">沟通内容*</label>
                                <div class="col-sm-8">
                                    <textarea id="Content" name="Content" class="form-control diff-textarea" rows="4">{$editdata.Content}</textarea>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">项目方参与人员</label>
                                <div class="col-sm-8">
                                    <input id="ProjectMember" name="ProjectMember" class="form-control" type="text"  value="{$editdata.ProjectMember}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">业主方参与人员</label>
                                <div class="col-sm-8">
                                    <input id="CustomMember" name="CustomMember" class="form-control" type="text"  value="{$editdata.CustomMember}">
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">成果文档及交付物</label>
                                <div class="col-sm-8">
                                    <textarea id="OutputContent" name="OutputContent" class="form-control diff-textarea" rows="6">{$editdata.OutputContent}</textarea>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 control-label">备注</label>
                                <div class="col-sm-8">
                                    <textarea id="Memo" name="Memo" class="form-control diff-textarea" rows="6">{$editdata.Memo}</textarea>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <div class="col-sm-8 col-sm-offset-3">
                                    <button class="btn btn-primary keep" type="submit">保存</button>
                                    <a class="btn btn-white" href="javascript:void(0);" onclick="self.location=document.referrer;">返回</a>
                                </div>
                            </div>
                        
                    </div>
                </div>
            </div>
           
            </form>
        </div>

    </div>

	<script src="__ROOT__/Public/Admin/js/jquery.min.js"></script>
	<script src="__ROOT__/Public/Admin/js/bootstrap.min.js"></script>
	<script src="__ROOT__/Public/Admin/js/plugins/layer/laydate/laydate.js"></script>
	<script src="__ROOT__/Public/Admin/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="__ROOT__/Public/Admin/js/ajaxForm.js"></script>
	<script src="__ROOT__/Public/Admin/js/plugins/sweetalert/sweetalert.min.js"></script>
 	
	<script>
		
		 $(document).ready(function () {
			var icon = "<i class='fa fa-times-circle'></i>";
			var form = $('form.js-ajax-forms');
			var formloading = false;
			form.validate({
				ignore:"",
		        //验证规则
		        rules: {
		            ComTime: {
		                required: true
		            },
		            Content: {
		                required: true
		            }
		        },
		        //验证未通过提示消息
		        messages: {
		            ComTime:{
		                required: icon + "请选择沟通时间"
		            },
		            Content:{
		                required: icon + "请选填写沟通内容"
		            }
		        },
		        //验证通过，提交表单
		        submitHandler : function(forms) {
		        	if (formloading)
	                return;
		            $(forms).ajaxSubmit({
		                url : form.attr('action'), //按钮上是否自定义提交地址(多按钮情况)
		                dataType : 'json',
		                beforeSubmit : function(arr, $form, options) {
		                    formloading = true;
		                },
		                success : function(data, statusText, xhr, $form) {
		                    formloading = false;
		                    if (data.status) {
		                        //添加成功
		                        swal({
		                            title: "继续操作？",
		                            text: "操作成功！",
		                            type: "success",
		                            showCancelButton: true,
		                            confirmButtonColor: "#DD6B55",
		                            confirmButtonText: "确认",
		                            cancelButtonText: "返回",
		                            closeOnConfirm: false,
		                            closeOnCancel: false
		                        },
		                        function (isConfirm) {
		                            if (isConfirm) {
		                                document.location.reload();
		                            } else {
		                                document.location.href = "{:U('ProjectWeekreport/index')}";
		                                return true;
		                            }
		                        }); 
		                    } else {
		                        swal("操作失败", data.info, "error");
		                    }
		                }
		            });
		        }
		    });
		});
		
		var ComTime = {
            elem: '#ComTime',
            format: 'YYYY-MM-DD mm:hh:ss',
            min: laydate.now(),
            max: '2099-06-16 23:59:59',
            istime: true,
            istoday: false,
            choose: function (datas) {
               
            }
        };
        laydate(ComTime);
	</script>
</body>

</html>
